package org.dragon.commons;

/**
 * Author:     Zhao Yan
 * DateTime:   2023/5/17 10:11
 */
public class ApplicationException extends RuntimeException {

    private final Errors errors;

    public Errors getErrors() {
        return errors;
    }

    public ApplicationException(Errors errors, String msg) {
        super(msg);
        this.errors = errors;
    }

    public ApplicationException(Errors errors) {
        super(errors.message);
        this.errors = errors;
    }

    public ApplicationException() {
        super(Errors.Unknown.message);
        this.errors = Errors.Unknown;
    }
}